package com.wisely.highlight_spring4.ch3.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
/**
 * @Conditional根据满足某一个特定条件满足一个特定的Bean
 * @author zhang
 *
 */
@Configuration
public class ConditionConfig {
	@Bean
	@Conditional(WindowsCondition.class)
	public WindowsListService windowsListService(){
		return  new WindowsListService();
	}
	@Bean
	@Conditional(LinuxCondition.class)
	public LinuxListService linuxListService(){
		return new LinuxListService();
	}
}
